#include <iostream>
#include <string>
#include <time.h>
using namespace std;
using std::endl;
using std::count;
int rnd = 0;
void PrintRndPass(int Length){
	char *charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
	int i = 0;
	//Setup random generator
	srand(time(0));
	while(i < Length){
		rnd = rand() & strlen(charset) - 1;
		//Print out password
		cout << charset[rnd];
		//INC counter
		i++;
	}
	cout << endl;
}
void main()
{
	int len = 0;
	system("title Password Generator");
	cout << "ͻ" << endl;
	cout << "Random Password Generator " << endl;
	cout << "ͼ" << endl;
	cout << "Enter length of password: ";
	//Read in length
	cin >> len;
	//Print password
	cout << "Password: ";
	PrintRndPass(len);
	//Pause
	system("pause");
}